var app = getApp()

module.exports = {
  // 把时间戳转成日期 
  date(a) {
    function add0(m) { 
      return m < 10 ? '0' + m : m
    }
    var date = new Date((a + '000') * 1);
    var Y = date.getFullYear() + '-';
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
    var D = add0(date.getDate()) + ' ';
    var h = add0(date.getHours()) + ':';
    var m = add0(date.getMinutes()) + ':';
    var s = add0(date.getSeconds());
    return Y + M + D + h + m + s //呀麻碟
  }
};